<template>
  <div class="data content">
    <div class="head_top">
      <ul>
        <li class="add_user">
          <div class="circle user">{{ title.increment_users }}</div>
          <span>今日新增用户</span>
        </li>
        <li class="count_user">
          <div class="circle user">{{ title.total_users }}</div>
          <span>总用户</span>
        </li>
        <li class="add_work">
          <div class="circle work">{{ title.increment_questions }}</div>
          <span>新增试题</span>
        </li>
        <li class="count_work">
          <div class="circle work">{{ title.total_questions }}</div>
          <span>总试题量</span>
        </li>
        <li class="count_worked">
          <div class="circle worked">{{ title.total_done_questions }}</div>
          <span>总刷题量</span>
        </li>
        <li class="one_work">
          <div class="circle worked">{{ title.personal_questions }}</div>
          <span>人均刷题量</span>
        </li>
      </ul>
    </div>
    <div class="main">
      <echarts></echarts>
    </div>
  </div>
</template>

<script>
import echarts from "@/components/chart.vue";
import { getTitle } from "@/api/data.js";
export default {
  components: {
    echarts,
  },
  data() {
    return {
      title: {},
    };
  },
  methods: {},
  created() {
    getTitle().then((res) => {
      console.log("title", res);
      this.title = res.data.data;
    });
  },
};
</script>

<style lang="less">
.data {
  .main {
    flex: 1;
  }
  .head_top {
    height: 149px;
    background: #fff;
    margin-bottom: 10px;
    padding: 10px;
    ul {
      width: 100%;
      height: 100%;
      padding-top: 10px;

      display: flex;
      justify-content: space-around;
      align-items: center;
      li {
        width: 104px;
        height: 100%;
        text-align: center;
        .circle {
          border-radius: 50px;
          text-align: center;
          line-height: 100px;
          margin-bottom: 10px;
          font-size: 24px;
        }
        span {
          color: #737373;
        }
      }
      li .user {
        border: 2px solid #0f8dfa;
        color: #0f8dfa;
      }

      li .work {
        border: 2px solid #f76840;
        color: #f76840;
      }

      li .worked {
        border: 2px solid #55cd78;
        color: #55cd78;
      }
    }
  }
}
</style>
